#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>

using namespace std;

class A
{
public:
	virtual void func()
	{
		cout << "A::func()" << endl;
	}

	int a;
};

class B :public A
{
public:
	virtual void func()
	{
		cout << "B::func()" << endl;
	}

	int b;
};

class C :public A
{
public:
	virtual void func()
	{
		cout << "C::func()" << endl;
	}

	int c;
};

class D :public B, public C
{
public:
	virtual void func()
	{
		cout << "D::func()" << endl;
	}
	virtual void func1()
	{
		cout << "d::func1()" << endl;
	}
};

int main()
{
	D d;
	d.A::a = 1;
	d.B::b = 2;
	d.C::c = 4;


	return 0;
}